package us.sunrisemorning.mykancolle.mapdata;

import org.apache.commons.lang3.RandomUtils;

import us.sunrisemorning.mykancolle.model.Mapcell;

public class MapData11 extends BaseMapData {
    private static final EnemyDeck[] no1 = new EnemyDeck[] { new EnemyDeck(501, -1, -1, -1, -1, -1, 1, "測試艦隊甲型"), new EnemyDeck(502, 501, 501, -1, -1, -1, 1, "測試艦隊乙型"), new EnemyDeck(503, 503, 502, 502, 501, 501, 1, "測試艦隊丙型") };

    public MapData11(long userId) {
        from_no = 0;
        no = 0;
        next = 1;
        maparea_id = 1;
        mapinfo_no = 1;
        bosscell_no = 3;

        Mapcell cell = Mapcell.dao.findFirst("select passed from Mapcell where maparea_id=? and mapinfo_no=? and member_id=? and id=?", maparea_id, mapinfo_no, userId, bosscell_no + 1);
        bosscomp = cell.getPassed();

        this.userId = userId;
        this.mapname = "1-1測試海域";
        this.maplevel = 1;
    }

    @Override
    public void moveNext() {
        from_no = no;
        no = next;
        switch (no) {
        case 1:
            next = RandomUtils.nextInt(2, 4);
            break;
        }
    }

    @Override
    public EnemyDeck getCurrentCellEnemyInfo() {
        switch (no) {
        case 1:
            return no1[RandomUtils.nextInt(0, no1.length)];
        }
        return null;
    }

    @Override
    protected int getEventKind() {
        switch (no) {
        case 1:
            return 1;
        }
        return 0;
    }

    @Override
    protected int getEventId() {
        switch (no) {
        case 1:
            return 4;
        }
        return 0;
    }

}
